Skip to content

fix: Update cy.press signature to be Chainable #31698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 14, 2025

Conversation

tgriesser
Copy link
Member

Since it's added via Commands.add, I believe cy.press should have a return type of Chainable<null> rather than void

Additional details

Steps to test

Tests should pass

tgriesser added 2 commits May 12, 2025 21:20
Since it's added via `Commands.add`, I believe `cy.press` should have a return type of `Chainable<null>` rather than `void`
Updated test for chainable
Copy link

cypress bot commented May 13, 2025

cypress    Run #62433

Run Properties:  status check failed Failed #62433  •  git commit 606cd69872: Merge branch 'develop' into update-cy.press-types
Project cypress
Branch Review update-cy.press-types
Run status status check failed Failed #62433
Run duration 19m 03s
Commit git commit 606cd69872: Merge branch 'develop' into update-cy.press-types
Committer Tim Griesser
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 9
Tests that did not run due to a developer annotating a test with .skip  Pending 1232
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 32158
View all changes introduced in this branch ↗︎
UI Coverage  45.83%
  Untested elements 190  
  Tested elements 165  
Accessibility  92.73%
  Failed rules  3 critical   9 serious   2 moderate   2 minor
  Failed elements 698  

Tests for review

Failed  cypress/e2e/e2e/origin/cookie_login.cy.ts • 1 failed test • 5x-driver-cdp-firefox

View Output

Test Artifacts
cy.origin - cookie login > general behavior > handles browser-sent cookies being overridden by server-kept cookies
    </td>
  </tr></table>
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-inject-document-domain-chrome

View Output

Test Artifacts
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary Test Replay
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-cdp-firefox

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Screenshots
Flakiness  commands/waiting.cy.js • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
... > errors > throws when waiting for 1st response to bar Test Replay

The first 5 flaky specs are shown, see all 9 specs in Cypress Cloud.

@jennifer-shehane
Copy link
Member

@tgriesser A type error in the implementation is showing up on check-ts:

src/cy/commands/actions/press.ts(76,32): error TS2345: Argument of type '(key: "Tab", userOptions?: (Partial & Partial) | undefined) => Promise' is not assignable to parameter of type 'CommandFn<"press">'.
Type 'Promise' is not assignable to type 'void | Chainable'.
Type 'Promise' is missing the following properties from type 'Chainable': and, as, blur, check, and 94 more.

@tgriesser
Copy link
Member Author

@jennifer-shehane should be fixed

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jennifer-shehane jennifer-shehane changed the title Update cy.press signature to be Chainable misc: Update cy.press signature to be Chainable May 13, 2025
@jennifer-shehane jennifer-shehane self-requested a review May 13, 2025 17:18
@jennifer-shehane jennifer-shehane changed the title misc: Update cy.press signature to be Chainable fix: Update cy.press signature to be Chainable May 14, 2025
@jennifer-shehane jennifer-shehane merged commit 8f8bb60 into develop May 14, 2025
5 of 6 checks passed
@jennifer-shehane jennifer-shehane deleted the update-cy.press-types branch May 14, 2025 13:52
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 20, 2025

Released in 14.4.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v14.4.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators May 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants